package red.client.core;

import red.client.cache.CacheClient;
import red.client.config.RedConfig;
import red.client.registry.RegistryClient;
import red.internal.client.net.DefaultRedClient;

import java.util.concurrent.ExecutorService;

/**
 * @author Jin Zheng
 * @since 2019-05-03
 */
public interface RedClient
{

	static RedClient newInstance(String address, RedConfig redConfig)
	{
		return new DefaultRedClient(address, redConfig);
	}

	static RedClient newInstance(String address, RedConfig redConfig, ExecutorService executorService)
	{
		return new DefaultRedClient(address, redConfig, executorService);
	}

	void start();

	void stop();

	void addConnectionListener(ConnectionListener listener);

	RegistryClient getRegistryClient();

	CacheClient getCacheClient();

}
